NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I try to retrive the polygon-data of the boundaries of cities in germany. I need to process these data in php.

My first approach was to send a request to Nominatim and retrieve JSON data in return. See this example: https://nominatim.openstreetmap.org/search.php?q=papenburg&polygon_geojson=1&format=json

But I red the usage policy of the Nominatim project and it seems to me that it is adverse to send automatic requests (out of my php script) to Nominatim. Afterwards I read about PBF Files and XML-Files and how to access the data, but it all seems to be much more complicated and I am not even sure if this would give my finally the information I need.

Is there any easy access to this data - or does anybody know which approach would be the best to retrieve the data I am looking for? Thank you in advance!

asked 06 Mar '19, 14:59

frlln's gravatar image

frlln
11112
accept rate: 0%


Have a look at https://wambachers-osm.website/boundaries/ In the left-pane navigation you can use right-mouse-click to select multiple levels. Countries are marked (2), states (4), cities can (6) or (7) depending on type (Bavaria markt, kreisfrei etc).

https://overpass-turbo.eu/ is also powerful. Zoom to the desired area and search for 'relation"admin_level"="6";' example https://overpass-turbo.eu/s/GI8 From inside a script you can query the API directly https://wiki.openstreetmap.org/wiki/Overpass_API

permanent link

answered 06 Mar '19, 15:14

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×129
×92
×92
×36

question asked: 06 Mar '19, 14:59

question was seen: 20,272 times

last updated: 06 Mar '19, 15:14

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum